\chapter{Introduction}
\label{chap:intro}
  Mobile robotics is nowadays a~prestigious research area. Building a~highly functional 
  mobile robot is considered to be a~difficult task. 
  It is a~fascinating process, which
  involves a~lot of engineering disciplines.
  
  A lot of affordable components result in~a~boom of simple robots used in~daily life. 
  Autonomous lawnmowers and vacuum cleaners are typical examples of mobile robots invasion~into our households in~these days.
  We also get used to robot prototypes, which are highly specialised in~the~space exploration~or in~army services.

  Despite the~rapid hardware development and robots increasing popularity,
  the~research in~the~field of mobile robots is at its beginning.
  Robots dominates in industry and they are already useful in our daily
  life, but the true real life problems are still difficult for them.
  Many complex problems like driving a car in full traffic or to move in human
  like environment are still a real challenge for a robot.
   
  The young scientists are often discouraged by
  studying hardware details during building their own robots.
  Luckily, several educational robots were made to help the novices.
  Educational robots help students focus on the other aspects of mobile robotics than the hardware one.
 
  This thesis describes and implements {\it Elib} library for e-Puck robot.
  E-Puck is a~typical example of an educational robot for students at the~university level. 
  It has a~clean, simple and robust mechanical design.
  Bluetooth wireless communication~enables sending data~between e-Puck and PC.
  A camera, eight infra~red (IR) sensors,	an accelerometer, encoders and three microphones 
  are enough for a~robot to feel the~real world.
  E-puck robot can reply to any type of perception~by performing several actions. 
  The robot is able to emit light from light emitting diodes (LEDs) or to play a~sound.
  Two stepper motors facilitate a~precise movement. 
  
%  Eight of e-Puck LEDs are located on~its perimeter. 
%  Four of green LEDs are placed in~its translucent body and
%  one stronger front LED is located next to the~camera. 
%  The front LED illuminates the~terrain~in~front of the~robot in~order to
%  provide camera with~additional light. 
%  The~LEDs together with the~speaker are usually used to
%  generate feedback. 
  
  E-puck's sensors and actuators allow to solve a~large scale of problems from the~field of mobile robotics. 
  On the~other hand, the~processing power of e-Puck does not allow to 
  process all outputs from its sensors. For example, resolution~from e-Puck's camera~is 640 * 480 pixels,
  but the~pictures taken from the~camera~are trimmed under 50 * 50 pixels, because there is a~lack of space in~
   e-Puck's microchip memory.
   
  E-puck robot and its sensors and actuators can be controlled only by a~low level C program,
  which needs to be downloaded to e-Puck's memory. The program runs on~the~robot's microchip.
  Programming e-Puck's microchip requires knowledge of sensors and actuators interfaces.
  Furthermore, debugging is limited to blinking with diodes or playing sounds.
  The mentioned reasons and insufficient processing power hinder rapid development 
  of even a~simple program, 
  which makes e-Puck programming inconvenient for students.

  One of the solution how to improve comfort for programmers is to control e-Puck from PC. 
  We have decided to implement this model and use {\it BTCom} program, which is delivered with e-Puck.
  {\it Elib} library uses {\it BTCom} program, which runs on e-Puck microchip, to control e-Puck.
  
  At the~time of writing this thesis there was only one well developed software called Webots for e-Puck, 
  which makes programming e-Puck easier.  
  Webots is a~commercial development and simulation~environment.
  Other simulators, which can be free alternatives for Webots, are introduced in~Chapter~\ref{chap:software}.
  
  The~{\it Elib} library removes the drawbacks of low level programming, 
  which is the~main contribution~of this work.
  {\it Elib} library runs on~PC and communicates with the~robot via~Bluetooth. 
  It uses {\it BTCom} program on~e-Puck.
  A program, which uses {\it Elib} library, 
  turns an e-Puck into a~carrier of sensors and actuators. 
  Such program sends commands to e-Puck,
  and the~whole algorithmic code runs comfortably on~PC.
  
  On the~other hand, the~implementation~of {\it Elib} brings new problems.
  This thesis introduces the~{\it Elib's} problems and discusses 
  under which conditions is the~approach of {\it Elib} suitable.	

  In order to facilitate fast development of applications based on~{\it Elib},
  we present its usage on several sample problems like following the light by the~robot.


  \subsubsection*{Thesis structure}
  We introduce mobile robotics in~Chapter~\ref{chap:robotics}.

  Chapter~\ref{chap:epuck} describes e-Puck design and presents its drawbacks and advantages.
  In Chapter~\ref{chap:software} we list software that 
  helps programmers to develop applications for robots.
  We also discuss the~usage of software for e-Puck, there. 
  
  Chapters~\ref{chap:elib} and~\ref{chap:usage} presents the~design 
  and usage of {\it Elib} library in~detail.
  Usage of {\it Elib} is shown on model behaviours, which includes 
  detecting colours, avoiding obstacles or following light.
  Conclusion~sums up the~properties of {\it Elib}.

  Appendix contains installation guides and a reference documentation. 
  A installation~guides of {\it Elib} and enclosed tools are located in Appendix~\ref{app:installelib}. 
  An installation and a~user guide for {\it Elib Joystick} application~is included in Appendix~\ref{app:joystick}. 
  {\it Elib's} reference documentation is included in Appendix~\ref{app:epuckref}.


